home *** CD-ROM | disk | FTP | other *** search
- /* Copyright (c) Mark J. Kilgard, 1994. */
-
- /* This program is freely distributable without licensing fees
- and is provided without guarantee or warrantee expressed or
- implied. This program is -not- in the public domain. */
-
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
- #include <assert.h>
-
- #include "glut.h"
- #include "glutint.h"
-
- void __glutCToStr255(const char *cs, Str255 ps)
- {
- int i = 255;
- *ps++ = strlen(cs);
- while(*cs && i--) *ps++ = *cs++;
- }
-
- /* CENTRY */
- void glutSetWindowTitle(const char *title)
- {
- Str255 ps;
-
- if(!__glutCurrentWindow || !__glutCurrentWindow->win)
- {
- __glutWarning("glutSetWindowTitle: no active window");
- return;
- }
-
- __glutCToStr255(title, ps);
-
- SetWTitle((GrafPort *) __glutCurrentWindow->win, ps);
- }
-
- void glutSetIconTitle(const char *title)
- {
- }
-
- void glutPositionWindow(int x, int y)
- {
- if(!__glutCurrentWindow || !__glutCurrentWindow->win)
- {
- __glutWarning("glutPositionWindow: no active window");
- return;
- }
-
- MoveWindow((GrafPort *) __glutCurrentWindow->win, x, y, GL_FALSE);
- }
-
- void glutReshapeWindow(int w, int h)
- {
- if(!__glutCurrentWindow || !__glutCurrentWindow->win)
- {
- __glutWarning("glutReshapeWindow: no active window");
- return;
- }
-
- if(w <= 0 || h <= 0)
- {
- __glutWarning("glutReshapeWindow: non-positive width or height not allowed");
- return;
- }
-
- SizeWindow((GrafPort *) __glutCurrentWindow->win, w, h, GL_FALSE);
- __glutWindowReshape(__glutCurrentWindow, w, h);
- }
-
- void glutPopWindow(void)
- {
- if(!__glutCurrentWindow || !__glutCurrentWindow->win)
- {
- __glutWarning("glutPopWindow: no active window");
- return;
- }
-
- BringToFront((GrafPort *) __glutCurrentWindow->win);
- }
-
- void glutPushWindow(void)
- {
- if(!__glutCurrentWindow || !__glutCurrentWindow->win)
- {
- __glutWarning("glutPushWindow: no active window");
- return;
- }
-
- SendBehind((GrafPort *) __glutCurrentWindow->win, 0);
- }
-
- void glutIconifyWindow(void)
- {
- }
-
- void glutShowWindow(void)
- {
- if(!__glutCurrentWindow || !__glutCurrentWindow->win)
- {
- __glutWarning("glutShowWindow: no active window");
- return;
- }
-
- ShowWindow((GrafPort *) __glutCurrentWindow->win);
- }
-
- void glutHideWindow(void)
- {
- if(!__glutCurrentWindow || !__glutCurrentWindow->win)
- {
- __glutWarning("glutHideWindow: no active window");
- return;
- }
-
- HideWindow((GrafPort *) __glutCurrentWindow->win);
- }
-
- /* ENDCENTRY */
-